package suphero;

public class s {
    public static void main(String[] args) {
        // Declare and initialize two geometric objects
        GeometricObject geoObject1 = new Circle(5);
        GeometricObject geoObject2 = new Rectangle(5, 3);
        GeometricObject geoObject3 = new triangle(5, 8, 5, 6);
        double max;
        double min;
        if (geoObject1.getArea() > geoObject2.getArea()){
            if (geoObject1.getArea() > geoObject3.getArea())
                max = geoObject1.getArea();
            else
                max = geoObject3.getArea();
        } else {
            if (geoObject2.getArea() > geoObject3.getArea())
                max = geoObject2.getArea();
            else
                max = geoObject3.getArea();
        }
        System.out.println("面积最大的为"+max);
        if (geoObject1.getPerimeter() < geoObject2.getPerimeter()){
            if (geoObject1.getPerimeter() < geoObject3.getPerimeter())
                min = geoObject1.getPerimeter();
            else
                min = geoObject3.getPerimeter();
        } else {
            if (geoObject2.getPerimeter() < geoObject3.getPerimeter())
                min = geoObject2.getPerimeter();
            else
                min = geoObject3.getPerimeter();
        }
        System.out.println("周长最小的为"+min);
    }
}